import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:power_house/pages/home/index.dart';
import 'package:power_house/routes.dart';
import 'package:power_house/scoped_model/auth.dart';
import 'package:power_house/scoped_model/city.dart';
import 'package:power_house/scoped_model/room_filter.dart';
import 'package:scoped_model/scoped_model.dart';

class Application extends StatelessWidget {
  const Application({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    FluroRouter router = FluroRouter();
    Routes.configureRoutes(router);
    return ScopedModel<AuthModel>(
      model: AuthModel(),
      child: ScopedModel<CityModel>(
          model: CityModel(),
          child: ScopedModel<FilterBarModel>(
              model: FilterBarModel(),
              child: MaterialApp(
                theme: ThemeData(primarySwatch: Colors.green),
                home: const HomePage(),
                onGenerateRoute: router.generator,
              ))),
    );
  }
}
